From 4cce73273d8facebe2f05f196133cc460e02ccb1 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Wed, 6 Aug 2025 10:52:46 +0200 Subject: [PATCH] brightnessManager: Move code around for the following commit Part-of: --- js/misc/brightnessManager.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/misc/brightnessManager.js b/js/misc/brightnessManager.js index 3e2dca879..a0402b9b4 100644 --- a/js/misc/brightnessManager.js +++ b/js/misc/brightnessManager.js @@ -140,18 +140,6 @@ export const BrightnessManager = GObject.registerClass({ .some(m => m.get_backlight() && m.is_active()); }); - if (monitors.length === 0) { - this._globalScale = null; - } else if (!this._globalScale) { - this._globalScale = new BrightnessScale(_('Brightness'), 1.0); - this._globalScale.connect('notify::value', () => { - if (this._inhibitUpdates) - return; - this._globalScaleChanged = true; - this._sync(); - }); - } - this._monitorScales.clear(); for (const monitor of monitors) { @@ -170,6 +158,18 @@ export const BrightnessManager = GObject.registerClass({ this._monitorScales.set(monitor, scale); } + if (monitors.length === 0) { + this._globalScale = null; + } else if (!this._globalScale) { + this._globalScale = new BrightnessScale(_('Brightness'), 1.0); + this._globalScale.connect('notify::value', () => { + if (this._inhibitUpdates) + return; + this._globalScaleChanged = true; + this._sync(); + }); + } + if (this._globalScale) this._sync({showOSD: false}); -- 2.39.5